package main;

import input.MyKeyListener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

import javax.swing.JPanel;
import javax.swing.Timer;

import util.WindowUtilities;
import GameObjects.GameObject;

public class Main 
{
	public static final int WINDOW_HEIGHT = 500;
	public static final int WINDOW_WIDTH = 500;
	
	//JFrame frame;
    JPanel panel;
    Timer timer;
    int timeIncrement;
	MyKeyListener keyListener;
	List<GameObject> gameObjects;
	Game game;
	
    public Main ()
    {
        super ();
        keyListener = new MyKeyListener();
		game = new Game(WINDOW_WIDTH, keyListener);
        panel = new MyJPanel(keyListener, WINDOW_WIDTH, WINDOW_HEIGHT, game);
        
        WindowUtilities.getFrameWithPanel(panel);       
        timer = new Timer (15, new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
		        panel.repaint (); 
			}
		});
       

    }


    public void run ()
    { 
        timer.start();
    }


    public static void main (String[] args)
    {
        new Main().run();
    }
    


}